#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n,min;
    int max = 0;
    cin >> n;
    vector<int> array(n);
    for (int i = 0; i < n; ++i) {
        cin >> array[i];
    }
    for(int i = 0; i<n;i++){
        if(array[i]>0 and array[i]>max){
            min=array[i];
        }
    }
    for(int i = 0; i<n;i++){
        if(array[i]>0 and array[i]<min){
            min=array[i];
        }
    }
    cout<<min;

}